import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

import java.rmi.RMISecurityManager;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.Naming;

import java.io.*;

public class SeedClient
{
	public static void main(String[] args)
	{

		System.setSecurityManager(null);
		//if (System.getSecurityManager() == null)
		//	System.setSecurityManager(new RMISecurityManager());
		try
		{
	
			SeedService remoteService =
				(SeedService) Naming.lookup("//127.0.0.1:9999/SeedService");

			String buffer;
			//InputStreamReader isr=new InputStreamReader(System.in);
			BufferedReader stdin =
				new BufferedReader(new InputStreamReader(System.in));

			while(true)
			{
				System.out.print("> ");
				buffer=stdin.readLine();
				if(buffer!=null)
					remoteService.changeMagical(Integer.parseInt(buffer));
			}
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}
}

